<% if !@form_valid %>
	<%= render :partial => "errors" %>
<% end %>

<% form_for(nil, :url => send_to_friends_path) do |f| %>
  <fieldset>
	<h3>Your friends</h3>
    <% @recipients.each_with_index do |recipient, i| %>
		<% f.object_name = "recipient_#{i}" %>
		<% f.object = recipient %>
        <div>
	        <label for="name_recipient">Name<% if i==0 %><span class="required">*</span><% end %></label>
	        <%= f.text_field :name, :class => "text" %>
				</div>
				<div>
	        <label for="email_recipient">Email<% if i==0 %><span class="required">*</span><% end %></label>
	        <%= f.text_field :email, :class => "text" %>
        </div>
    <% end %>
    
    <% f.object_name = "sender" %>
    <% f.object = @sender %>
    <div>
    <label for="name_sender">Your name<span class="required">*</span></label>
    <%= f.text_field :name, :class => "text" %>
  	</div>
    <div>
    <label for="email_sender">Your email<span class="required">*</span></label>
    <%= f.text_field :email, :class => "text" %>
  	</div>
		<div>
    <%= f.text_area :message %>
		</div>
  <input type="submit" class="submit-button" value="Send-a-Friend" />

	<div>
		<span class="required">*</span> required fields
	</div>

	</fieldset>
<% end %>